Imports System.Diagnostics

Namespace Seuss.EnterpriseLibrary.Logger

    Public Class ClsLogger

        'WriteToEventLog: Write to Web Server Log 
        Public Shared Sub WriteToEventLog(ByVal e As Exception, ByVal action As String, ByVal EventSource As String, ByVal EventLog As String)

            Dim Log As EventLog = New EventLog()
            Log.Source = EventSource
            Log.Log = EventLog

            Dim Message As String = "An exception occurred communicating with the data source." & vbCrLf & vbCrLf
            Message &= "Action: " & action & vbCrLf & vbCrLf
            Message &= "Exception: " + e.ToString()

            Log.WriteEntry(Message)

        End Sub
    End Class

End Namespace
